Component({
  properties: {
    title: {
      type: String,
      default: '',
    },
    showIcon: {
      type: Boolean,
      default: true,
    },
  },
  data: {
    statusBarHeight: 0,
    titleBarHeight: 0,
  },
  ready() {
    let titleBarHeight = '';
    let statusBarHeight = '';
    wx.getSystemInfo({
      success: res => {
        titleBarHeight = res.model.indexOf('iPhone') !== -1 ? 44 : 48;
        statusBarHeight = res.statusBarHeight;
        this.setData({
          statusBarHeight,
          titleBarHeight,
        });
      },
    });
  },
});
